#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "Ds1302.h"

int main(void)
{
	OLED_Init();
	OLED_ShowString(1,1,"RTC");
	DS1302_Init();
	DS1302_TimeSet();
	OLED_ShowChar(1,3,'-');
	OLED_ShowChar(1,6,'-');
	OLED_ShowChar(2,3,':');
	OLED_ShowChar(2,6,':');	
	
	while (1)
	{
		DS1302_TimeRead();
		OLED_ShowNum(1,1,DS1302_Time[0], 2);
		OLED_ShowNum(1,4,DS1302_Time[1], 2);
		OLED_ShowNum(1,7,DS1302_Time[2], 2);
		OLED_ShowNum(2,1,DS1302_Time[3], 2);
		OLED_ShowNum(2,4,DS1302_Time[4], 2);
		OLED_ShowNum(2,7,DS1302_Time[5], 2);	
	}
}
